package com.example.demo.mapper;

import com.example.demo.pojo.Goodsaddguanli;
import com.example.demo.pojo.UserInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author yanglup
 * @create 2020-12-12 16:35
 */
@Mapper
public interface UserInfoMapper {
    /**查询是否有用户信息*/
    @Select("select * from userInfo where openid=#{openid}")
    Integer userInfocheck(String openid);
    /**插入用户信息*/
    @Insert("insert into userInfo values(#{avatarUrl},#{openid},#{nickName},#{gender},#{city},#{province},#{country})")
    void userInfoadd(String openid,String nickName,Integer gender,String city,String province,String country,String avatarUrl);


    /**************************************************************userInfoBack后台管理系统**************************************************************************/
    /**用户后管理*/
    @Select("select * from userInfo")
    List<UserInfo> BackUserInfolist();
    /**用户管理列表数量*/
    @Select("select count(*) from userInfo")
    Integer BackUserInfolistnumber();

    /**删除用户*/
    @Delete("delete from userInfo where openid=#{openid}")
    void BackUserInfodelete(String openid);
}
